//package com.yonyou.ucf.mdf.app.isvdxq.plugin;
//
//import com.yonyou.iuap.yms.api.IYmsJdbcApi;
//import com.yonyou.iuap.yms.dao.BaseDAO;
//import com.yonyou.iuap.yms.id.generator.YmsOidGenerator;
//import com.yonyou.iuap.yms.param.SQLParameter;
//import com.yonyou.iuap.yms.param.VOStatus;
//import com.yonyou.iuap.yms.processor.AutoBeanProcessor;
//import com.yonyou.ucf.mdf.app.isvdxq.plugin.bean.DxqLocation;
//import com.yonyou.ypd.bill.annotation.BillPlugin;
//import com.yonyou.ypd.bill.context.YpdBillContext;
//import com.yonyou.ypd.bill.plugin.AbstractBillPlugin;
//import org.springframework.beans.factory.annotation.Autowired;
//
//import javax.annotation.Resource;
//
//@BillPlugin(busiObj="dxq_location")
//public class LocationPlugin extends AbstractBillPlugin {
//
//    // ymsjdbc 增删改查
//    @Resource(name = "baseDAO", type = BaseDAO.class)
//    IYmsJdbcApi iYmsJdbcApi;
//
//    // 自动生成id
//    @Autowired
//    private YmsOidGenerator ymsOidGenerator;
//
//
//    @Override
//    public void beforeSave(YpdBillContext billContext) throws Exception {
//
////        if (DxqLocation.ENTITY_NAME.equals(billContext.getBillDO().getMetaFullName())) {
////            DxqLocation billDO = (DxqLocation) billContext.getBillDO();
////            if (VOStatus.NEW == billDO.get_status()) {
////                // 一般适用于手动造数据，保存默认会赋值id，无需重新赋值
////                String id = ymsOidGenerator.nextStrId();
////            }
////
////            StringBuffer sqlBuffer = new StringBuffer();
////            sqlBuffer.append("select id from ? ");
////            SQLParameter sqlParameter = new SQLParameter();
////            sqlParameter.addParam(billDO.getTableName());
////
////            sqlBuffer.append(" where id = ? ");
////            sqlParameter.addParam(billDO.getId());
////            iYmsJdbcApi.queryForObject(sqlBuffer.toString(), new AutoBeanProcessor(billDO));
////        }
//
////        else if (ElnCourseType.ENTITY_NAME.equals(billContext.getBillDO().getMetaFullName())) {
////            ElnCourseType elnCourseType = (ElnCourseType) billContext.getBillDO();
////            ElnCourseType elnCourseType_new = (ElnCourseType) iYmsJdbcApi.queryByPK(new ElnCourseType(), elnCourseType.getId());
////
////            StringBuffer sqlBuffer = new StringBuffer();
////            sqlBuffer.append("select id from ? ");
////            SQLParameter sqlParameter = new SQLParameter();
////            sqlParameter.addParam(elnCourseType.getTableName());
////
////            sqlBuffer.append(" where id = ? ");
////            sqlParameter.addParam(elnCourseType.getId());
////            iYmsJdbcApi.queryForObject(sqlBuffer.toString(), new AutoBeanProcessor(elnCourseType));
////        }
//
//
//        super.beforeSave(billContext);
//    }
//
//}
